
from datetime import date,datetime
from json import dumps
import os
def init_logs():
    """使用loguru记录日志，此函数为日志初始化

    :return:
    """
    from loguru import logger
    root_path = os.path.abspath(os.path.dirname(__file__)).split('applications')[0]
    file_name='sanic_test.log'
    log_path = os.path.join(root_path, 'applications', 'logs', file_name)
    logger.info(log_path)
    # 每天00:01会创建一个新的文件
    logger.add(log_path,rotation="00:01")
    return logger
